package com.itheima.vo;

import lombok.Data;

import java.io.Serializable;

@Data
public class ResultInfo implements Serializable {
    private Integer code;
    private String msg;
    private Object data;

    public static ResultInfo success(Object object) {
        ResultInfo resultInfo = new ResultInfo();
        resultInfo.data=object;
        resultInfo.code=1;
        return resultInfo;
    }

    public static ResultInfo error(String msg) {
        ResultInfo resultInfo = new ResultInfo();
        resultInfo.msg=msg;
        resultInfo.code=0;
        return resultInfo;
    }
}
